-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/non bound substitution variables #605
Conversation
WalkthroughThe recent update introduces a new test case in the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- x/logic/keeper/grpc_query_ask_test.go (1 hunks)
- x/logic/util/prolog.go (1 hunks)
Additional comments: 5
x/logic/util/prolog.go (4)
- 76-78: Skipping non-bound variables in
envsToResults
function is a crucial step towards ensuring determinism by excluding unbound variables from the results. This change directly addresses the issue described in the PR objectives.- 81-83: The error handling in
scanExpression
call withinenvsToResults
is correctly implemented. By returning early in case of an error, it ensures that the error is propagated up and handled appropriately, maintaining the robustness of the system.- 92-104: The
scanExpression
function is well-implemented, with clear error handling and a straightforward return of theSubstitution
type. This function encapsulates the logic for scanning expressions and extracting the necessary information, contributing to the modularity and maintainability of the code.- 106-111: The
isBound
function provides a concise and effective way to check if a parsed variable is bound in the given environment. This utility function enhances code readability and reuse, aligning with best practices for code modularity.x/logic/keeper/grpc_query_ask_test.go (1)
- 195-204: Adding a new test case to verify the handling of non-bound substitution variables is a good practice. It ensures that the changes made to the system's logic are correctly implemented and that the system behaves as expected in scenarios involving non-bound variables. This test case contributes to the overall robustness and reliability of the system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes perfect! Important one thanks 🙏
🎉 This PR is included in version 7.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Prevent non-bound substitution variables to be returned. These kind of variables are converted into string terms with a prefix of
_
followed by a number, such as_88
. The numeric part is unpredictable and may vary across different nodes of the chain, compromising determinism — a situation that is problematic, as you know.For instance:
Before:
After:
The expression value for X has been removed.
Summary by CodeRabbit